package com.liyunc.op.mem.synch.dto.rest;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author liyuncong
 * @version 1.0
 * @file GenericResponse
 * @brief GenericResponse
 * @details GenericResponse
 * @date 2023-04-14
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                        NAME               DESCRIPTION
 * 2023-04-14                  liyuncong          Created
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GenericResponse<T> {
    private Integer code;
    private String message;
    private T payload;

    public static <T> GenericResponse<T> of(T payload) {
        return new GenericResponse<>(200, "", payload);
    }
}
